package com.video.netty.InChannelHandler;

import com.alibaba.fastjson.JSONObject;
import com.video.service.webcon.IRecordService;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 删除会议记录
 * {"id":"delrecord", "recordname":"1_2018-12-03_14-54-39.webm"}
 */
@BaseChannelHandler.MsgHandler
public class WsDelrecordChannelHandler extends BaseChannelHandler {

    @Autowired
    private IRecordService recordService;

    @Override
    protected String msgId() {
        return "delrecord";
    }

    @Override
    protected void msgHandler(JSONObject json) throws Exception {
        String recordname = json.getString("recordname");
        recordService.deleteRecordByName(recordname);
    }
}
